import request from "@/utils/request";
import type { AxiosPromise } from "axios";
import type { AnnouncementQuery, AnnouncementVo } from "@/api/monitor/announcementSend/types";

/**
 * 查询系统通告表
 * @param query
 * @returns {*}
 */
export const listMyAnnouncement = (query?: AnnouncementQuery): AxiosPromise<AnnouncementVo[]> => {
  return request({
    url: "/system/sysAnnouncementSend/getMyAnnouncementSend",
    method: "get",
    params: query
  });
};

/**
 * 一键阅读
 */
export const readAll = () => {
  return request({
    url: "/system/sysAnnouncementSend/readAll",
    method: "post"
  });
};

/**
 * 通过通告ID修改数据
 *
 * @param antId 通告ID
 */
export const editByAntIdAndUserId = (antId: string | number) => {
  return request({
    url: "/system/sysAnnouncementSend/editByAntIdAndUserId/" + antId,
    method: "post"
  });
};
